﻿<html>
<head>
<meta charset="UTF-8">
<title>文件上传表单</title>
</head>
<body>
<h3>文件上传：</h3>
选择一个文件上传: <br />
<form action="/file_upload" method="post" enctype="multipart/form-data">
<input type="file" name="image" size="50" />
<br />
<input type="submit" value="上传文件" />
</form>
<button type="button" onclick="loadXMLDoc()">查询文件清单</button>
<script>
                        //AJAX
                        function loadXMLDoc()
                        {
                            var xmlhttp;
                            var str;
                            if (window.XMLHttpRequest)
                            {// code for IE7+, Firefox, Chrome, Opera, Safari
                                xmlhttp=new XMLHttpRequest();
                            }
                            else
                            {// code for IE6, IE5
                                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                            }
                            xmlhttp.onreadystatechange=function()
                            {
                                if (xmlhttp.readyState==4 && xmlhttp.status==200)
                                {
                                    str = xmlhttp.responseText;//得到服务器响应
                                    document.getElementById("myDiv").innerHTML=str;
                                }
                            }

                            xmlhttp.open("GET","/filelist.js",true);
                            xmlhttp.send();
                        }
                    </script>
</body>
</html>